<?php
/**
 * @author wyl
 * @date 2015-8-26 14:05:08
 */
Yii::import('system.web.widgets.CWidget');
class BidButton extends CWidget{
	public $label;
	public $auction_id;
	public $customer_id;
	
	public function init(){
		$this->label=(empty($this->label))?'BID':$this->label;	
	}
	
	public function run(){
		$this->renderBidButton();
		$this->addScript();	
	}
	
	public function renderBidButton(){
		echo CHtml::htmlButton($this->label,array(
			'class'			=>'btn btn-default btn-bid auction-bid-button',
			'auction-id'	=>$this->auction_id,
			'customer_id'	=>$this->customer_id
		));
	}
	
	public function addScript(){
		Yii::app()->clientScript->registerScript('bid-button-js',"
			
		");
		Yii::app()->clientScript->registerCss('bid-button-css', "
			.btn.btn-bid{
				padding-left:35px;
				padding-right:35px;
				font-weight:700;
				font-size:14px;
				background-color:#d40d12;
			}
		");
	}
}		
